import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

// 1.创建组件(路由的)，可以从其他文件 import 进来
// 2.创建路由并与路由映射
// 3.创建router实例
// 4.导入去挂载到根实例
import Home from '../views/Home.vue'
import User from '../views/User.vue'
import Main from '../views/Main.vue'
import Mall from '../views/Mall.vue'
import PageOne from '../views/PageOne.vue'
import PageTwo from '../views/PageTwo.vue'
import Login from '../views/Login.vue'
const routes = [
    // 主路由
    {
        path: '/', 
        component: Main, 
        name:'Main',
        redirect:'/home',//重定向
        children: []
    },
    {
      path:'/login',
      name:'login',
      component:Login
    }
]
const router = new VueRouter({
    routes
})
export default router
